package com.palrevo.data.models;

import java.util.ArrayList;
import java.util.List;

/**
 * @author AAsha
 *
 */
@SuppressWarnings("serial")
public class Advertisement implements Model {

	private Long id;
	private String title;
	private String body;
	private List<AdverAttachment> adverAttchments = new ArrayList<AdverAttachment>();
	private Integer indx;
	private String type;
	
	public Advertisement() {
		super();
	}

	public Advertisement(Long id, String title, String body, List<AdverAttachment> adverAttchments, Integer index, String type) {
		super();
		this.id = id;
		this.title = title;
		this.body = body;
		this.indx = index;
		this.type = type;
		this.adverAttchments = adverAttchments;
	}
	
	public Advertisement(Advertisement adv) {
		super();
		this.id = adv.id;
		this.title = adv.title;
		this.body = adv.body;
		this.indx = adv.indx;
		this.type = adv.type;
		this.adverAttchments = adv.adverAttchments;
	}

	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public String getTitle() {
		return title;
	}

	public void setTitle(String title) {
		this.title = title;
	}

	public String getBody() {
		return body;
	}

	public void setBody(String body) {
		this.body = body;
	}

	public Integer getIndx() {
		return indx;
	}

	public void setIndx(Integer indx) {
		this.indx = indx;
	}

	public String getType() {
		return type;
	}

	public void setType(String type) {
		this.type = type;
	}
	
	public List<AdverAttachment> getAdverAttchments() {
		return adverAttchments;
	}

	public void setAdverAttchments(List<AdverAttachment> adverAttchments) {
		this.adverAttchments = adverAttchments;
	}
	
	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((id == null) ? 0 : id.hashCode());
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		Advertisement other = (Advertisement) obj;
		if (id == null) {
			if (other.id != null)
				return false;
		} else if (!id.equals(other.id))
			return false;
		return true;
	}

	@Override
	public String getTableName() {
		return null;
	}

	@Override
	public List<String> getFields() {
		return null;
	}

}
